<template>
  <q-layout view="hHh lpR lFr">

    <q-page-container>
      <router-view />
    </q-page-container>

  </q-layout>
</template>

<script>
import { defineComponent, ref } from 'vue';
import { useMeta } from 'quasar';
import { useStore } from 'stores/store';

export default defineComponent({
  name: 'LoginLayout',
  preFetch ({ store, currentRoute, previousRoute, redirect, ssrContext, urlPath, publicPath }) {
    // const path = urlPath.split('/');
    // if (path[1] === 'main') { // 进入main再取字典数据
    //   const $store = useStore(store);
    //   return $store.fetchGeneralConfig(); // 一定要return一个promise，才能对pinia执行异步预取数据
    // }
  },
  setup (props, context) {
    const $store = useStore();

    useMeta({
      // 设置文件标题
      title: `${$store.siteConfig.appName} - 木多鱼系列`,
      meta: {
        description: {
          name: 'description',
          content: $store.siteConfig.description || $store.siteConfig.subTitle
        }
      }
    });
  }
});
</script>
